package cn.skyisazure.metacompare.metaVo;

import cn.skyisazure.metacompare.sqlcompare.mysql.MysqlColumnType;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;

import java.util.LinkedHashMap;
import java.util.List;

@Data
public class MetaColumnConfigVO {

    private String id;
    private String key;
    private String name;
    private MysqlColumnType type;
    private String description;
    private String defaultValueMode;
    private String defaultValue;
    private String comment;
    private String relationId;
    private Boolean isNullable;
    private Boolean isGenerated = false;
    private Boolean isForeignKey = false;
    private Boolean isTreeParent = false;
    private Boolean isUnique;
    private Integer sort;
    private Boolean isPrimaryKey = false;
    private Boolean isCreateUser = false;
    private Boolean isUpdateUser = false;
    private Boolean isCreateDate = false;
    private Boolean isUpdateDate = false;
    private Boolean isDeleteDate = false;
    private Boolean isDeleteUser = false;
    private Boolean isDeleteFlag = false;
    private JSONObject validations;
    private JSONObject validationErrors;


    private Object length;
    private Object format;
    private Object formatMsg;
    private Object dbType;
    private Object precision;
    private Object scale;
    private Object salt;
    private Object token;
    private Object driver;
    private Object accept;
    private Object allowedTypes;
    private Object restrictRatio;
    private Object restrictRatioCustom;
    private String meiptions;
    private Object options;
    private Object source;
    private Object currency;
    private Object allowInput;
    private Object formula;
    private Object maxDate;
    private Object minDate;
    private Object maxDateMsg;
    private Object minDateMsg;
    private Object maxSize;
    private String onText;
    private String offText;
    // {"rules":[{"type":"date","format":"YYYY"},{"type":"auto-increase","options":{"start":1,"length":3,"rrule":"none"}}],"sort":1,"foreignKeyFlag":false,"systemFieldType":0,"nullable":true,"allowedTypes":"","defaultValueMode":"null","code":"f","value":"f","defaultValue":"","name":"f","type":"serial-number","description":"asdasdasdasdasdasd","colTypeName":"","precision":10,"scale":"","nullEnableFlag":true}
    private List<LinkedHashMap<String,Object>> rules;

}
